export default class Logger {
    static enable() {
        Logger.enable = true;
    }

    static print(level, ...args) {
        if (!Logger.enable) {
            return;
        }

        if (!console[level]) {
            throw new Error(`Unknown log level: ${level}`);
        }

        console[level](...args);
    }

    static log(...args) {
        Logger.print('log', ...arguments);
    }

    static warn(...args) {
        Logger.print('warn', ...arguments);
    }

    static error(...args) {
        Logger.print('error', ...arguments);
    }
}